<?php
include_once( "include/global.php" );
include_once( "include/process_db.php" );
include_once( "include/check_login.php" );

header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json');

// the data array to return
$ret = array();
$ret["status"] = "success";
$ret["error_msg"] = "";

// open database
OpenDB();

// prepare sql
$sql = "DELETE FROM main WHERE AutoID=" . $_GET["auto_id"] . ";";
if( !mysql_query($sql) )
{
	$ret["status"] = "fail";
	$ret["error_msg"] = "刪除失敗.";
}


// close database
CloseDB();

// return data
echo json_encode( $ret );
?>
